package schach.server.model;

import java.io.Serializable;
import java.util.ArrayList;

public abstract class Figur implements Serializable {

	private boolean alive;
	private boolean black;
	private Feld position;
	private int noOfMoves;
	
	public Figur(Feld position, boolean alive, boolean black){
		this.position = position;
		this.alive = alive;
		this.black = black;
		noOfMoves = 0;
	}
	public void move(Feld f){
		setPosition(f);
		noOfMoves++;
	}
	public abstract ArrayList<Feld> crossedFields(Feld f, boolean schlagen) throws NullPointerException;
	public boolean isAlive() {
		return alive;
	}
	public void setDead() {
		alive = false;
	}
	public boolean isBlack() {
		return black;
	}
	public Feld getPosition() {
		return position;
	}
	public int getNoOfMoves(){
		return noOfMoves;
	}
	public void setPosition(Feld f) {
		position = f;
	}
	
}
